/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: stl_set.cpp
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月30日 星期三 11时20分01秒
***************************************************/

#include <iostream>

#include <set> // 包含集合容器的头文件


using namespace std;
int main(int argc,const char* argv[])
{
	set<int> age;

	pair<set<int>::iterator,bool> ret;

	age.insert(20);
	age.insert(10);
	ret = age.insert(30);
	cout << ret.second << endl;
	cout << *ret.first << endl;
	ret = age.insert(30);
	cout << "========" << endl;	
	cout << ret.second << endl;
	cout << *ret.first << endl;
	cout << "========" << endl;	
	for (auto it = age.begin(); it != age.end(); ++it)
		cout << *it << endl;

	auto it = age.find(10);
	if (it != age.end()) {
		cout << "the val 10 is in the set" << endl;
	}

#if 1
	if (age.end( != age.find(50)) {
		cout << "the val 50 is in the set" << endl;
	}
#endif

    return 0;
}

